/**
 */
package ConnectorGenerator.DRD.impl;

import ConnectorGenerator.CommunicationStyle.CommunicationStyle;

import ConnectorGenerator.DRD.Allocation;
import ConnectorGenerator.DRD.Component;
import ConnectorGenerator.DRD.Connector;
import ConnectorGenerator.DRD.DRDDocument;
import ConnectorGenerator.DRD.DRDPackage;
import ConnectorGenerator.DRD.Dock;

import ConnectorGenerator.Signature.Signature;

import ConnectorGenerator.impl.ConnectorSpecificationImpl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Document</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ConnectorGenerator.DRD.impl.DRDDocumentImpl#getCommunicationStyles <em>Communication Styles</em>}</li>
 *   <li>{@link ConnectorGenerator.DRD.impl.DRDDocumentImpl#getDocks <em>Docks</em>}</li>
 *   <li>{@link ConnectorGenerator.DRD.impl.DRDDocumentImpl#getComponents <em>Components</em>}</li>
 *   <li>{@link ConnectorGenerator.DRD.impl.DRDDocumentImpl#getAllocations <em>Allocations</em>}</li>
 *   <li>{@link ConnectorGenerator.DRD.impl.DRDDocumentImpl#getConnectors <em>Connectors</em>}</li>
 *   <li>{@link ConnectorGenerator.DRD.impl.DRDDocumentImpl#getSignatures <em>Signatures</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DRDDocumentImpl extends ConnectorSpecificationImpl implements DRDDocument {
	/**
	 * The cached value of the '{@link #getCommunicationStyles() <em>Communication Styles</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCommunicationStyles()
	 * @generated
	 * @ordered
	 */
	protected EList<CommunicationStyle> communicationStyles;

	/**
	 * The cached value of the '{@link #getDocks() <em>Docks</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDocks()
	 * @generated
	 * @ordered
	 */
	protected EList<Dock> docks;

	/**
	 * The cached value of the '{@link #getComponents() <em>Components</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getComponents()
	 * @generated
	 * @ordered
	 */
	protected EList<Component> components;

	/**
	 * The cached value of the '{@link #getAllocations() <em>Allocations</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAllocations()
	 * @generated
	 * @ordered
	 */
	protected EList<Allocation> allocations;

	/**
	 * The cached value of the '{@link #getConnectors() <em>Connectors</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConnectors()
	 * @generated
	 * @ordered
	 */
	protected EList<Connector> connectors;

	/**
	 * The cached value of the '{@link #getSignatures() <em>Signatures</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSignatures()
	 * @generated
	 * @ordered
	 */
	protected EList<Signature> signatures;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DRDDocumentImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DRDPackage.Literals.DRD_DOCUMENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<CommunicationStyle> getCommunicationStyles() {
		if (communicationStyles == null) {
			communicationStyles = new EObjectContainmentEList<CommunicationStyle>(CommunicationStyle.class, this, DRDPackage.DRD_DOCUMENT__COMMUNICATION_STYLES);
		}
		return communicationStyles;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Dock> getDocks() {
		if (docks == null) {
			docks = new EObjectContainmentEList<Dock>(Dock.class, this, DRDPackage.DRD_DOCUMENT__DOCKS);
		}
		return docks;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Component> getComponents() {
		if (components == null) {
			components = new EObjectContainmentEList<Component>(Component.class, this, DRDPackage.DRD_DOCUMENT__COMPONENTS);
		}
		return components;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Allocation> getAllocations() {
		if (allocations == null) {
			allocations = new EObjectContainmentEList<Allocation>(Allocation.class, this, DRDPackage.DRD_DOCUMENT__ALLOCATIONS);
		}
		return allocations;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Connector> getConnectors() {
		if (connectors == null) {
			connectors = new EObjectContainmentEList<Connector>(Connector.class, this, DRDPackage.DRD_DOCUMENT__CONNECTORS);
		}
		return connectors;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Signature> getSignatures() {
		if (signatures == null) {
			signatures = new EObjectContainmentEList<Signature>(Signature.class, this, DRDPackage.DRD_DOCUMENT__SIGNATURES);
		}
		return signatures;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case DRDPackage.DRD_DOCUMENT__COMMUNICATION_STYLES:
				return ((InternalEList<?>)getCommunicationStyles()).basicRemove(otherEnd, msgs);
			case DRDPackage.DRD_DOCUMENT__DOCKS:
				return ((InternalEList<?>)getDocks()).basicRemove(otherEnd, msgs);
			case DRDPackage.DRD_DOCUMENT__COMPONENTS:
				return ((InternalEList<?>)getComponents()).basicRemove(otherEnd, msgs);
			case DRDPackage.DRD_DOCUMENT__ALLOCATIONS:
				return ((InternalEList<?>)getAllocations()).basicRemove(otherEnd, msgs);
			case DRDPackage.DRD_DOCUMENT__CONNECTORS:
				return ((InternalEList<?>)getConnectors()).basicRemove(otherEnd, msgs);
			case DRDPackage.DRD_DOCUMENT__SIGNATURES:
				return ((InternalEList<?>)getSignatures()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case DRDPackage.DRD_DOCUMENT__COMMUNICATION_STYLES:
				return getCommunicationStyles();
			case DRDPackage.DRD_DOCUMENT__DOCKS:
				return getDocks();
			case DRDPackage.DRD_DOCUMENT__COMPONENTS:
				return getComponents();
			case DRDPackage.DRD_DOCUMENT__ALLOCATIONS:
				return getAllocations();
			case DRDPackage.DRD_DOCUMENT__CONNECTORS:
				return getConnectors();
			case DRDPackage.DRD_DOCUMENT__SIGNATURES:
				return getSignatures();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case DRDPackage.DRD_DOCUMENT__COMMUNICATION_STYLES:
				getCommunicationStyles().clear();
				getCommunicationStyles().addAll((Collection<? extends CommunicationStyle>)newValue);
				return;
			case DRDPackage.DRD_DOCUMENT__DOCKS:
				getDocks().clear();
				getDocks().addAll((Collection<? extends Dock>)newValue);
				return;
			case DRDPackage.DRD_DOCUMENT__COMPONENTS:
				getComponents().clear();
				getComponents().addAll((Collection<? extends Component>)newValue);
				return;
			case DRDPackage.DRD_DOCUMENT__ALLOCATIONS:
				getAllocations().clear();
				getAllocations().addAll((Collection<? extends Allocation>)newValue);
				return;
			case DRDPackage.DRD_DOCUMENT__CONNECTORS:
				getConnectors().clear();
				getConnectors().addAll((Collection<? extends Connector>)newValue);
				return;
			case DRDPackage.DRD_DOCUMENT__SIGNATURES:
				getSignatures().clear();
				getSignatures().addAll((Collection<? extends Signature>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case DRDPackage.DRD_DOCUMENT__COMMUNICATION_STYLES:
				getCommunicationStyles().clear();
				return;
			case DRDPackage.DRD_DOCUMENT__DOCKS:
				getDocks().clear();
				return;
			case DRDPackage.DRD_DOCUMENT__COMPONENTS:
				getComponents().clear();
				return;
			case DRDPackage.DRD_DOCUMENT__ALLOCATIONS:
				getAllocations().clear();
				return;
			case DRDPackage.DRD_DOCUMENT__CONNECTORS:
				getConnectors().clear();
				return;
			case DRDPackage.DRD_DOCUMENT__SIGNATURES:
				getSignatures().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case DRDPackage.DRD_DOCUMENT__COMMUNICATION_STYLES:
				return communicationStyles != null && !communicationStyles.isEmpty();
			case DRDPackage.DRD_DOCUMENT__DOCKS:
				return docks != null && !docks.isEmpty();
			case DRDPackage.DRD_DOCUMENT__COMPONENTS:
				return components != null && !components.isEmpty();
			case DRDPackage.DRD_DOCUMENT__ALLOCATIONS:
				return allocations != null && !allocations.isEmpty();
			case DRDPackage.DRD_DOCUMENT__CONNECTORS:
				return connectors != null && !connectors.isEmpty();
			case DRDPackage.DRD_DOCUMENT__SIGNATURES:
				return signatures != null && !signatures.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //DRDDocumentImpl
